/********************************************************************************
  * @file     SD93F115B_exti.h
  * @author   TEST TEAM 												    	
  * @version  v0															    	
  * @date     Septemper 2022												    	
  * @brief  
  *           
  * Copyright (C) 2022  Hangzhou SDIC Microelectronics Co., Ltd
  ******************************************************************************/

/* Define to prevent recursive inclusion */
#ifndef __SD93F115B_EXINT_H
#define __SD93F115B_EXINT_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes */
#include "SD93F115B.h"


/*---------------------------------------------------- 
 * @brief  EXINT Trigger enumeration  
 *----------------------------------------------------*/

#define  EXINT_Trigger_Falling 				     0x0000                        //下降沿触发中断
#define  EXINT_Trigger_Rising 			 		 EXINT_CR_INTEDGE0_0           //上升沿触发中断
#define  EXINT_Trigger_Rising_Falling	 		 EXINT_CR_INTEDGE0_1           //双边沿触发中断

#define IS_EXINT_TRIGGER(TRIGGER) (((TRIGGER) == EXINT_Trigger_Rising)||\
                                   ((TRIGGER) == EXINT_Trigger_Falling)||\
								   ((TRIGGER) == EXINT_Trigger_Rising_Falling)) 

								  
#define EXINT_INT0       						EXINT_CR_INT0IE  
#define EXINT_INT1       						EXINT_CR_INT1IE 
#define EXINT_KEY        						EXINT_CR_KEYIE  

#define EXINT_KEY0       						EXINT_CR_KEY0EN 
#define EXINT_KEY1       						EXINT_CR_KEY1EN  
#define EXINT_KEY2       						EXINT_CR_KEY2EN 
#define EXINT_KEY3       						EXINT_CR_KEY3EN  
#define EXINT_KEY4       						EXINT_CR_KEY4EN  
#define EXINT_KEY5       						EXINT_CR_KEY5EN  
#define EXINT_KEY6       						EXINT_CR_KEY6EN  

#define IS_EXINT_Channel(Channel) (((Channel) == EXINT_INT0)||((Channel) == EXINT_INT1)||\
								   ((Channel) == EXINT_KEY))||((Channel) == EXINT_KEY0)||\
								   ((Channel) == EXINT_KEY1)||((Channel) == EXINT_KEY2)||\
								   ((Channel) == EXINT_KEY3)||((Channel) == EXINT_KEY4)||\
								   ((Channel) == EXINT_KEY5)||((Channel) == EXINT_KEY6))
								

/* Interrupts and flags management functions */								
void EXINT_DeInit(void);                                                                        //复位外部中断及按键中断相关的寄存器为上电默认值
void EXINT_EXITCmd(uint16_t EXINT_INTx, uint16_t EXINT_Trigger,FunctionalState NewState);       //外部中断使能
void EXINT_KeyCmd(uint16_t EXINT_KEYx, FunctionalState NewState);                               //按键中断使能

ITStatus EXINT_GetEXITStatus(uint16_t EXINT_Channel);                                           //获取外部中断或按键中断标志位
void EXINT_ClearEXITStatus(uint16_t EXINT_Channel);                                             //清除外部中断或按键中断标志位

#ifdef __cplusplus
}
#endif

#endif /* __SD93F115B_EXINT_H */

/*****************************END OF FILE**************************************/




